//
//  WSHeadActViewCell.m
//  LANGirl
//
//  Created by 杨泓晔 on 16/3/15.
//  Copyright © 2016年 杨泓晔. All rights reserved.
//

#import "WSHeadActViewCell.h"

@interface WSHeadActViewCell ()

@property (nonatomic, strong) UIImageView *icoImage;
@property (nonatomic, strong) UILabel *nameLabel;

@end

@implementation WSHeadActViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)createSubView {

    self.icoImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_icoImage];
    [self.icoImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerX.equalTo(self.contentView);
        make.centerY.equalTo(self.contentView).offset(-10);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH / 7, SCREEN_WIDTH / 7));
    }];
    self.icoImage.layer.cornerRadius = SCREEN_WIDTH / 7 / 2;
    self.icoImage.layer.masksToBounds = YES;
    
    self.nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerX.equalTo(self.contentView);
        make.top.equalTo(self.icoImage.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH / 3, 30 *AUTO_WIDTH));
    }];
    self.nameLabel.textColor = TextGrayColor;
    self.nameLabel.textAlignment = NSTextAlignmentCenter;
    self.nameLabel.font = [UIFont systemFontOfSize:TEXTCONTENTFONT];
}

- (void)setImage:(UIImage *)image {

    _image = image;
    self.icoImage.image = _image;
}

- (void)setNameStr:(NSString *)nameStr {

    _nameStr = nameStr;
    self.nameLabel.text = _nameStr;
}

@end
